package re.jf.echangeur.ihm;

import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.GroupLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class ComparerFichierJFrame extends javax.swing.JFrame {
  /**
   * 
   */
  private static final long serialVersionUID = 1L;

  /**
   * Auto-generated main method to display this JFrame
   */
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        ComparerFichierJFrame inst = new ComparerFichierJFrame();

        inst.setLocationRelativeTo(null);
        inst.setVisible(true);
      }
    });
  }

  private JFrame parent;

  private JPanel jPanel1;

  private String path;

  public ComparerFichierJFrame() {
    super();
    initGUI();
    affichageControlCreation(false);
    ouverture();
  }

  private void affichageControlCreation(boolean b) {

  }

  private void fermeture() {
    parent.setVisible(true);
  }

  private void initGUI() {
    try {
      setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
      addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent evt) {
          thisWindowClosing(evt);
        }

        @Override
        public void windowOpened(WindowEvent evt) {
          thisWindowOpened(evt);
        }
      });
      {
        jPanel1 = new JPanel();
        GroupLayout jPanel1Layout = new GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        getContentPane().add(jPanel1, BorderLayout.CENTER);
        jPanel1.setPreferredSize(new java.awt.Dimension(570, 338));

        jPanel1Layout.setVerticalGroup(jPanel1Layout.createSequentialGroup());
        jPanel1Layout.setHorizontalGroup(jPanel1Layout.createSequentialGroup());
      }
      pack();
      setSize(400, 300);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  private void ouverture() {
    if (parent != null) {
      parent.setVisible(false);
    }
  }

  public void setParent(JFrame parent) {
    this.parent = parent;
  }

  private void thisWindowClosing(WindowEvent evt) {
    fermeture();
  }

  private void thisWindowOpened(WindowEvent evt) {
    ouverture();
  }

  public void setPath(String path) {
    this.path = path;
  }

  public String getPath() {
    return path;
  }
}
